var vm = new Vue({
    el: '#page_set',
    data(){
        return {
            Basic:{
                START_MIN:true,
                TOP_MOST:true,
                AUTO_CLEAN_CACHE:true
            },Hotkey:{
                input_1:'Win + ~',
                input_2:'无'
            },Advanced:{
                RAM_OPTIMIZER:true,
                CHECK_UPDATE:true
            }
        }
    },methods: {
        Basic_switch_click(e){
            if(e==1){win_reconfig("CONFIG","START_MIN",vm.Basic.START_MIN)}
            if(e==2){win_reconfig("CONFIG","TOP_MOST",vm.Basic.TOP_MOST)}
            if(e==3){win_reconfig("CONFIG","AUTO_CLEAN_CACHE",vm.Basic.AUTO_CLEAN_CACHE)}
        },Advanced_switch_click(e){
            if(e==1){win_reconfig("CONFIG","RAM_OPTIMIZER",vm.Advanced.RAM_OPTIMIZER)}
            if(e==2){win_reconfig("CONFIG","CHECK_UPDATE",vm.Advanced.CHECK_UPDATE)}
        }
    }
});

$(function(){
    $(".set_nav a").click(function(e){
        $(".set_nav a").removeAttr("sel");
        $(this).attr("sel","");
    }),$("#close").click(function(){
        $(".main").fadeOut(function(){
            win_out()
        })
    })
    
}),$(function(){
    $("#page_set").scroll(function () {
        var b = $("#page_set").height();

        if (b - $("#Basic").offset().top > b/2) {
            $(".set_nav a").removeAttr("sel");
            $("a[href=#Basic]").attr("sel","");
        }

        if (b - $("#Hotkey").offset().top > b/2) {
            $(".set_nav a").removeAttr("sel");
            $("a[href=#Hotkey]").attr("sel","");
        }

        if (b- $("#Advanced").offset().top > b/2) {
            $(".set_nav a").removeAttr("sel");
            $("a[href=#Advanced]").attr("sel","");
        }
    })
})

